{% extends 'KeioStudyBundle::layout.html.twig' %}

{% block content %}
    <h2 style="padding-bottom:20px">Danh sách câu hỏi</h2>

    <table class="records_list" width="100%">
        <thead>
            <tr>
                <th class="records_list" style="width:7%; text-align:center">STT</th>
                <th class="records_list">Tiêu đề</th>
                <th class="records_list">Loại</th>
                <th class="records_list">Nội dung</th>
                <th class="records_list">Gợi ý</th>
                <th class="records_list">Môn học</th>
                <th class="records_list" style="width:7%;">Điểm</th>
                <th class="records_list" style="width:120px">Actions</th>
            </tr>
        </thead>
        <tbody>
        {% set sothutu = 0 %}
        {% for entity in entities %}
        {% set sothutu = sothutu+1 %}
            <tr style="height:55px"
        	{% if sothutu is divisibleby(2) %}
        	class="records_list_chan"
	        {% endif %}
	        >
                <td class="records_list" align="center">{{ sothutu }}</td>
                <td class="records_list">{{ entity.tieude }}</td>
                <td class="records_list">
                	{% if entity.loai==0 %}
                		Trắc nghiệm
                	{% else %}
                		Tự trả lời
                	{% endif %}
                </td>
                <td class="records_list">{{ entity.noidungshort|raw }}</td>
                <td class="records_list">{{ entity.goiyshort|raw }}</td>
                <td class="records_list">{{ entity.monhoc }}</td>
                <td class="records_list" style="text-align:right">{{ entity.diem }}</td>
                <td class="records_list">
                  <table width=100%>
    	            <tr>
	                  <td style="width:33%;">
                	<form action="{{ path('keio_cauhoi_delete', { 'id': entity.id }) }}" method="post">
            	        {{ form_widget(entity.delform) }}
        	            <div id="record_list">
	        	            <input title="Delete" type="image" src="{{ asset('icons/delete.png') }}" onclick="return confirm('Chắc chắn xóa không?')" />
        	            </div>
    	            </form>
	                  </td>
                	  <td style="width:33%; padding-left:5px">
            	        <a href="{{ path('keio_cauhoi_show', { 'id': entity.id }) }}"><img title="Detail" src="{{ asset('icons/detail.png') }}" /></a>
        	          </td>
        	          <td style="padding-left:5px">
            	        <a href="{{ path('keio_cauhoi_edit', { 'id': entity.id }) }}"><img title="Edit" src="{{ asset('icons/edit.png') }}" /></a>
        	          </td>
    	            </tr>
	              </table>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

        <ul>
        <li>
            <a href="{{ path('keio_cauhoi_newtracnghiem') }}">
                New trac nghiem
            </a>
        </li>
        <li>
            <a href="{{ path('keio_cauhoi_newtutraloi') }}">
                New design question
            </a>
        </li>
    </ul>
    {% endblock %}
